<?php

namespace Database\Factories;

use Illuminate\Database\Eloquent\Factories\Factory;
use App\Models\Banner;

class BannerFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        $links = [
            [
                'link_type' => Banner::LINK_TYPE_INSIDE,
                'link' => '/index/index'
            ],
            [
                'link_type' => Banner::LINK_TYPE_OUTSIDE,
                'link' => 'wxb3abba27d7a448ed|/pages/find/recommend/recommend'
            ],
            [
                'link_type' => Banner::LINK_TYPE_WEB,
                'link' => 'https://www.baidu.com'
            ]
        ];
        $link = $this->faker->randomElement($links);
        $sign = $this->faker->randomElement(['home','user']);
        return [
            'sign' => $sign,
            'title' => $this->faker->sentence(),
            'link_type' => $link['link_type'],
            'link' => $link['link'],
            'order' => $this->faker->numberBetween(1,100),
            'valid' => $this->faker->boolean(),
            'image' => $this->faker->imageUrl(),
        ];
    }
}
